import 'package:permission_handler/permission_handler.dart';

///权限管理器
///
// undetermined 不确定的 未知的
// granted 授予
// denied 拒绝
// restricted 受限制的
// permanentlyDenied
class PermissionManager {
  ///申请权限
  ///
  static Future<void> requestPermission(Permission permission) async {
    return await permission.request();
  }

  static Future<bool> checkPermission(Permission permission) async {
    PermissionStatus statuses = await permission.status;
    return statuses.isGranted ? true : false;
  }
}
